home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_pow_shields.cog < prev    next >
Text File  |  1998-02-25  |  1KB  |  71 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # POW_SHIELDS.COG
  4. #
  5. # POWERUP Script - Shields
  6. #
  7. # [YB & CYW]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing       powerup                          local
  15. thing       player                           local
  16. int         bin=60                           local
  17. sound       pickupsnd=helthpu1.wav           local
  18. sound       respawnsnd=Activate01.wav        local
  19. flex        amount                           local
  20.  
  21. message     touched
  22. message     taken
  23. message     respawn
  24.  
  25. end
  26.  
  27. # ========================================================================================
  28.  
  29. code
  30.  
  31. touched:
  32.    player = GetSourceRef();
  33.    amount = GetInv(player, bin);
  34.  
  35.    if (amount < GetInvMax(player, bin))
  36.    {
  37.       TakeItem(GetSenderRef(), -1);
  38.       call taken;
  39.    }
  40.  
  41.    Return;
  42.  
  43. # ........................................................................................
  44.  
  45. taken:
  46.    player = GetSourceRef();
  47.    powerup = GetSenderRef();
  48.  
  49.    // Print("Shield Recharge");
  50.    jkPrintUNIString(player, bin);
  51.  
  52.    // Do effects.
  53.    PlaySoundLocal(pickupsnd, 1, 0, 0);
  54.    AddDynamicTint(player, 0.0, 0.0, 0.2);
  55.  
  56.    // Increment powerup amount.
  57.    ChangeInv(player, bin, 20.0);
  58.  
  59.    Return;
  60.  
  61. # ........................................................................................
  62.  
  63. respawn:
  64.    PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
  65.  
  66.    Return;
  67.  
  68. end
  69.  
  70.  
  71.